/*     */ package com.lmpop.trade.ti_finance_history;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.dao.IbatisDbmImpl;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_finance_historyInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_finance_historyInfo()
/*     */   {
/*  17 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  27 */     String result_code = "0";
/*  28 */     if (map.getString("use_vmoney") == null) {
/*  29 */       map.setString("result_code", result_code);
/*  30 */       return map;
/*     */     }
/*  32 */     RandomID randomID = new RandomID();
/*  33 */     String trade_id = randomID.GenTradeId();
/*  34 */     Ti_finance_history ti_finance_history = new Ti_finance_history();
/*  35 */     ti_finance_history.setTrade_id(trade_id);
/*  36 */     ti_finance_history.setCust_id(map.getString("cust_id"));
/*  37 */     ti_finance_history.setNum(map.getString("num"));
/*  38 */     ti_finance_history.setType(map.getString("type"));
/*  39 */     ti_finance_history.setReason(map.getString("reason"));
/*  40 */     ti_finance_history.setUser_id(map.getString("user_id"));
/*  41 */     ti_finance_history.setRemark(map.getString("remark"));
/*  42 */     ti_finance_history.setVmoney(map.getString("vmoney"));
/*  43 */     ti_finance_history.setUse_vmoney(map.getString("use_vmoney"));
/*     */     try
/*     */     {
/*  47 */       insert(dbmMgr, ti_finance_history);
/*     */     } catch (ApplicationException e) {
/*  49 */       e.printStackTrace();
/*  50 */       result_code = "1";
/*     */     }
/*  52 */     map.setString("result_code", result_code);
/*  53 */     return map;
/*     */   }
/*     */ 
/*     */   public SysMap reginsert(DbmInterf dbmMgr, SysMap map) {
/*  57 */     RandomID randomID = new RandomID();
/*  58 */     String trade_id = randomID.GenTradeId();
/*  59 */     String result_code = "0";
/*  60 */     Ti_finance_history ti_finance_history = new Ti_finance_history();
/*  61 */     ti_finance_history.setTrade_id(trade_id);
/*  62 */     ti_finance_history.setCust_id(map.getString("cust_id"));
/*  63 */     ti_finance_history.setNum(map.getString("use_vmoney"));
/*  64 */     ti_finance_history.setUser_id(map.getString("user_id"));
/*  65 */     ti_finance_history.setRemark(map.getString("remark"));
/*  66 */     ti_finance_history.setVmoney(map.getString("vmoney"));
/*  67 */     ti_finance_history.setUse_vmoney(map.getString("use_vmoney"));
/*     */ 
/*  69 */     ti_finance_history.setType("0");
/*  70 */     ti_finance_history.setReason("init success");
/*     */     try {
/*  72 */       insert(dbmMgr, ti_finance_history);
/*     */     } catch (ApplicationException e) {
/*  74 */       e.printStackTrace();
/*  75 */       result_code = "1";
/*     */     }
/*     */ 
/*  78 */     ti_finance_history.setType("1");
/*  79 */     ti_finance_history.setReason("init success");
/*     */     try {
/*  81 */       insert(dbmMgr, ti_finance_history);
/*     */     } catch (ApplicationException e) {
/*  83 */       e.printStackTrace();
/*  84 */       result_code = "1";
/*     */     }
/*     */ 
/*  87 */     ti_finance_history.setType("1");
/*  88 */     ti_finance_history.setReason("init success");
/*     */     try
/*     */     {
/*  91 */       insert(dbmMgr, ti_finance_history);
/*     */     } catch (ApplicationException e) {
/*  93 */       e.printStackTrace();
/*  94 */       result_code = "1";
/*     */     }
/*     */ 
/*  97 */     map.setString("result_code", result_code);
/*  98 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_finance_history ti_finance_history)
/*     */     throws ApplicationException
/*     */   {
/* 106 */     dbmMgr.update("insertTi_finance_history", ti_finance_history);
/*     */   }
/*     */ 
/*     */   public void insert(Ti_finance_history ti_finance_history) {
/* 110 */     DbmInterf dbmMgr = new IbatisDbmImpl();
/* 111 */     dbmMgr.updateSql("insertTi_finance_history", ti_finance_history);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 120 */     String pkid_string = map.getString("pkid");
/* 121 */     String result_code = "0";
/*     */     try {
/* 123 */       if (!pkid_string.equals("")) {
/* 124 */         String[] pkStr = pkid_string.split("\\|");
/* 125 */         for (int i = 0; i < pkStr.length; i++) {
/* 126 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 130 */       e.printStackTrace();
/* 131 */       result_code = "1";
/*     */     }
/* 133 */     map.setString("result_code", result_code);
/* 134 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 143 */     dbmMgr.update("deleteTi_finance_history", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap deleteByCustID(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 153 */     String pkid_string = map.getString("pkid");
/* 154 */     String result_code = "0";
/*     */     try {
/* 156 */       if (!pkid_string.equals("")) {
/* 157 */         String[] pkStr = pkid_string.split("\\|");
/* 158 */         for (int i = 0; i < pkStr.length; i++) {
/* 159 */           if (pkStr[i].equals("")) continue; deleteByCustID(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 163 */       e.printStackTrace();
/* 164 */       result_code = "1";
/*     */     }
/* 166 */     map.setString("result_code", result_code);
/* 167 */     return map;
/*     */   }
/*     */ 
/*     */   public void deleteByCustID(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 176 */     dbmMgr.update("deleteTi_finance_historyByCust_Id", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 185 */     Ti_finance_history ti_finance_history = new Ti_finance_history();
/* 186 */     ti_finance_history.setTrade_id(map.getString("trade_id"));
/* 187 */     ti_finance_history.setCust_id(map.getString("cust_id"));
/* 188 */     ti_finance_history.setNum(map.getString("num"));
/* 189 */     ti_finance_history.setType(map.getString("type"));
/* 190 */     ti_finance_history.setReason(map.getString("reason"));
/* 191 */     ti_finance_history.setIn_date(map.getString("in_date"));
/* 192 */     ti_finance_history.setUser_id(map.getString("user_id"));
/* 193 */     ti_finance_history.setRemark(map.getString("remark"));
/*     */ 
/* 195 */     String result_code = "0";
/*     */     try {
/* 197 */       update(dbmMgr, ti_finance_history);
/*     */     } catch (ApplicationException e) {
/* 199 */       e.printStackTrace();
/* 200 */       result_code = "1";
/*     */     }
/* 202 */     map.setString("result_code", result_code);
/* 203 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_finance_history ti_finance_history)
/*     */     throws ApplicationException
/*     */   {
/* 212 */     dbmMgr.update("updateTi_finance_history", ti_finance_history);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 222 */     Map ti_finance_history = (Hashtable)obj;
/* 223 */     if (start == 0)
/* 224 */       start = 0;
/*     */     else {
/* 226 */       start = (start - 1) * limit;
/*     */     }
/* 228 */     ti_finance_history.put("start", Integer.valueOf(start));
/* 229 */     ti_finance_history.put("limit", Integer.valueOf(limit));
/* 230 */     return this.queryList.getList("getListByTi_finance_historyPage", ti_finance_history);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 241 */     Map ti_finance_history = (Hashtable)obj;
/* 242 */     List list = this.queryList.getList("getCountByObjTi_finance_history", obj);
/* 243 */     int count = 0;
/* 244 */     if ((list != null) && (list.size() > 0)) {
/* 245 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 246 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 247 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 250 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 260 */     return this.queryList.getList("getTi_finance_historyByPk", pk);
/*     */   }
/*     */ 
/*     */   public void insertti_finance_history(Map map)
/*     */   {
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_finance_history.Ti_finance_historyInfo
 * JD-Core Version:    0.6.0
 */